import { createApp } from 'vue'

import App from './App.vue'


import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import './style.css'
import * as Icons from '@element-plus/icons-vue';
import router from './router';
import { createPinia } from 'pinia';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import { useLoading } from './utils/loading'


const app = createApp(App)
for (const [key, value] of Object.entries(Icons)) {
  app.component(key, value);
}

const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);

app.use(router)
app.use(ElementPlus)
app.use(pinia)
app.mount('#app')
app.config.globalProperties.$loading = useLoading()

